module UsersHelper



	def could_follow(user)
		return false unless current_user.present?
		return false  if (user.blank? || (user.id == current_user.id))

		return true
	end

	def follow_usr_tag(user,opts={})
		return '' if current_user.blank?
		return '' if user.blank?
		return '' if current_user.id== user.id
		followed=current_user.followed?(user)
		icon= '<i class="fa fa-user"></i>'
		opts[:class] ||="btn btn-primary btn-block"
		class_name="button-follow-user #{opts[:class]}"
		if followed
			link_to raw("#{icon}<span>取消关注</span>"),'#','data-id'=> user.id,class: "#{class_name} active"
		else
			link_to raw("#{icon}<span>关注</span>"),'#','data-id'=> user.id,class: class_name
		end

	end
	#<a data-id="1" class="button-follow-user btn btn-primary btn-block" href="#"><i class="fa fa-user"></i><span>关注</span></a>
end
